﻿using ReporterEngine;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.IO;

namespace ReportEngine_TestProject
{
    
    
    /// <summary>
    ///This is a test class for ReportManagerTest and is intended
    ///to contain all ReportManagerTest Unit Tests
    ///</summary>
    [TestClass()]
    public class ReportManagerTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Report
        ///</summary>
        [TestMethod()]
        public void ReportTest()
        {
            ReportManager target = new ReportManager(); // TODO: Initialize to an appropriate value
            
            ReportSettingsArgs settings = new ReportSettingsArgs
                                               {
                                                   TemplatePath = "c:\\Users\\vavdav\\Documents\\Provision Reports\\report template 1\\Templates\\tpl1.docx",
                                                   ResultPath = "c:\\Users\\vavdav\\Documents\\Provision Reports\\report template 1\\results\\tpl1.docx",
                                                   ModelPath = "c:\\Users\\vavdav\\Documents\\Provision Reports\\report template 1\\export\\cif.xml"
                                               }; 
            
            
            target.Report(settings);
            
            
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        [TestMethod()]
        public void Report2Test()
        {
            ReportManager target = new ReportManager(); // TODO: Initialize to an appropriate value


            ReportSettingsArgs settings = new ReportSettingsArgs
            {
                TemplatePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),"Provision Reports\\report template 1\\Templates\\tpl2.docx"),
                ResultPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),"Provision Reports\\report template 1\\results\\tpl2.docx"),
                ModelPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),"Provision Reports\\report template 1\\export\\cif.xml")
            };


            target.Report(settings);


            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        [TestMethod()]
        public void Report3Test()
        {
            ReportManager target = new ReportManager(); // TODO: Initialize to an appropriate value


            ReportSettingsArgs settings = new ReportSettingsArgs
            {
                TemplatePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Provision Reports\\report template 2\\Templates\\NT-SMK-T-Kniha_procesov.docx"),
                ResultPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Provision Reports\\report template 2\\results\\NT-SMK-T-Kniha_procesov.docx"),
                ModelPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Provision Reports\\report template 2\\export\\cif.xml"),
                ExportPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Provision Reports\\report template 2\\export")
            };


            target.Report(settings);


            File.WriteAllText(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Provision Reports\\report template 2\\results\\log.txt"),ReportManager.DebugLog);

            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

    }
}
